package com.kuaiyan.sdkshell.ad;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import com.kuaiyan.sdkshell.R;
import com.wmcsk.KuaiyanSdk;
import com.wmcsk.defaultImp.DefaultChapingAdapter;

/**
 * Created by wm on 2017/12/18.
 */
public class ChapingActivity extends BaseActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chaping);
        initTitleView();
        setTitleText("插屏广告");
        //插屏---------------------------------------------------------------------
        //第一个参数为该广告位的唯一值，第二个为需要依附的viewGroup，第三个为广告位id，第四个为广告回调监听
        KuaiyanSdk.getInstance().requestChapingAd("Index3Activity_Five", null, "76", new DefaultChapingAdapter() {
            @Override
            public Dialog createDiaLog() {
                Dialog dialog = new Dialog(ChapingActivity.this, R.style.dialog) {
                    @Override
                    public void show() {
                        Log.e("MainActivity_chaping", "showdialog");
                        super.show();
                    }
                };
                return dialog;
            }

            @Override
            public void threadError(int code, String message, Exception e) {
                super.threadError(code, message, e);
                Log.e("MainActivity_chaping", code + "   " + message);
            }
        });
    }
}
